import request from '@/utils/request'

// 查询房间列表
export function listHome(query) {
  return request({
    url: '/lock/home/list',
    method: 'get',
    params: query
  })
}
export function listHome2(query) {
  return request({
    url: '/lock/home/list2',
    method: 'get',
    params: query
  })
}
// 查询房间列表（简化版）
export function listHome3(query) {
  return request({
    url: '/lock/home/list3',
    method: 'get',
    params: query
  })
}

// 查询房间详细
export function getHome(id) {
  return request({
    url: '/lock/home/' + id,
    method: 'get'
  })
}

// 获取房间列表
export function getHomeList(query) {
  return request({
    url: '/lock/home/list',
    method: 'get',
    params: query
  })
}

// 新增房间
export function addHome(data) {
  return request({
    url: '/lock/home',
    method: 'post',
    data: data
  })
}

// 修改房间
export function updateHome(data) {
  return request({
    url: '/lock/home',
    method: 'put',
    data: data
  })
}

// 删除房间
export function deleteHome(id) {
  return request({
    url: '/lock/home/' + id,
    method: 'delete'
  })
}

// 获取房间下的门锁列表
export function getHomeLocks(id) {
  return request({
    url: '/lock/home/locks/' + id,
    method: 'get'
  })
}

// 获取房间租户列表
export function getHomeTenants(id) {
  return request({
    url: '/lock/home/tenants/' + id,
    method: 'get'
  })
}

// 获取房间钥匙列表
export function getHomeKeys(id) {
  return request({
    url: '/lock/home/keys/' + id,
    method: 'get'
  })
}

// 获取房间入住二维码
export function getHomeQrcode(id) {
  return request({
    url: '/lock/home/qrcode/' + id,
    method: 'get'
  })
} 